package cn.faifai.framework.utils.fetcher;

import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.WinNT;

public class SidFetcher {

    public static String getSid() {
        String accountName = System.getProperty("user.name");

        // 获取当前用户的安全标识符(SID)
        Advapi32Util.Account accountByName = Advapi32Util.getAccountByName(accountName);
        String sid = accountByName.sidString;

        return sid;
    }
    public static void main(String[] args) {
        String accountName = System.getProperty("user.name");

        // 获取当前用户的安全标识符(SID)
        Advapi32Util.Account accountByName = Advapi32Util.getAccountByName(accountName);
        String sid = accountByName.sidString;

        System.out.println("SID: " + sid);
    }
}